Subroutine to print the layers of a two_level self_organized_map
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(two_level_self_organizing_map) | :: | kohonen_map |
A |
|||
integer, | optional | :: | unit_ |
An integer variable with the unit |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | unit1 | ||||
integer, | public | :: | ix | ||||
integer, | public | :: | iy | ||||
integer, | public | :: | iz | ||||
integer, | public | :: | ic | ||||
real(kind=wp), | public, | dimension(kohonen_map%number_variables1*kohonen_map%number_variables2) | :: | centers | |||
real(kind=wp), | public, | dimension(kohonen_map%number_variables1*kohonen_map%number_variables2, kohonen_map%number_clusters) | :: | centers1 |
subroutine print_2lsom(kohonen_map,unit_) !======================================================================================== !! Subroutine to print the layers of a two_level self_organized_map class(two_level_self_organizing_map) :: kohonen_map !! A `two_level_self_organizing_map` object integer,optional :: unit_ !! An integer variable with the unit integer :: unit1,ix,iy,iz,ic real(kind=wp),dimension(kohonen_map%number_variables1*kohonen_map%number_variables2) :: centers real(kind=wp),dimension(kohonen_map%number_variables1*kohonen_map%number_variables2,& kohonen_map%number_clusters) :: centers1 ! if(.not. present(unit_)) then unit1=6; else unit1=unit_; endif ! write(unit1,*) 'TWO LEVEL SOM: Results'; write(unit1,*) call kohonen_map%parameters(1)%print(unit1); ! write(unit1,*) 'After' write(unit1,*) write(unit1,*) 'TWO LEVEL SOM: Grid nodes'; write(unit1,*) do iz=1,size(kohonen_map%grid,3); do ix=1,size(kohonen_map%grid,1); do iy=1,size(kohonen_map%grid,2); write(unit1,*) ix,iy,iz call kohonen_map%grid(ix,iy,iz)%print(unit1); enddo!iy enddo!ix enddo write(unit1,*) write(unit1,*) 'TWO LEVEL SOM: Grid Hit count'; write(unit1,*) write(unit1,*) 'Pattern Numbers'; do iz=1,size(kohonen_map%number_patterns,3) write(unit1,*) write(unit1,*) 'Layer ',iz write(unit1,*) do ix=1,size(kohonen_map%number_patterns,1) write(unit1,'(100I5)') (kohonen_map%number_patterns(ix,iy,iz),iy=1,size(kohonen_map%number_patterns,2)) enddo enddo write(unit1,*) write(unit1,*) 'TWO LEVEL SOM: Grid Pattern index' write(unit1,*) write(unit1,*) write(unit1,*) 'Pattern #, ix ,iy'; do ix=1,size(kohonen_map%cells_index,1) write(unit1,'(100I5)') ix, (kohonen_map%cells_index(ix,iy),iy=1,size(kohonen_map%cells_index,2)) enddo write(unit1,*) write(unit1,*) 'TWO LEVEL SOM: Cluster nodes'; write(unit1,*) open(2,file='cluster_centers.out',status='unknown') do ic=1,size(kohonen_map%cluster_layer); write(unit1,*) 'Cluster= ',ic call kohonen_map%cluster_layer(ic)%print(unit1); call kohonen_map%cluster_layer(ic)%get_prototype(centers) centers1(:,ic)=centers(:) enddo!ic do ix=1,size(centers1,1) write(2,*) ix,(centers1(ix,ic),ic=1,size(centers1,2)) enddo close(2) ! write(unit1,*) write(unit1,*) 'TWO LEVEL SOM: Cluster Pattern index' write(unit1,*) ! do ix=1,size(kohonen_map%cluster_cells_index,1) write(unit1,*) (kohonen_map%cluster_cells_index(ix,iy),iy=1,size(kohonen_map%cluster_cells_index,2)) enddo ! do iz=1,size(kohonen_map%grid_cluster,3); write(unit1,*) 'Layer ',iz do ix=1,size(kohonen_map%grid_cluster,1); write(unit1,'(100I5)') (kohonen_map%grid_cluster(ix,iy,iz),iy=1,size(kohonen_map%grid_cluster,2)) enddo!ix enddo!iz ! end subroutine print_2lsom